#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "Key.h"
#include "Servo.h"

uint8_t num = 0;

int main(void)
{
	OLED_Init();
	Key_Init();
	Servo_Init();
	OLED_ShowString(1, 1, "Angle:");
	while (1)
	{
		num += Key1_In();
		if (num > 4)
		{
			num = 0;
		}
		OLED_ShowNum(1, 7, num * 45, 3);
		Servo_AngleSet(num);
	}
}
